﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using JTicket.BLL;
namespace JTicket.UI
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["OperInfo"] != null)
            {
                try
                {
                    Model.D_OperInfo operinfo = (Model.D_OperInfo)Session["OperInfo"];
                    //记录日志
                    Model.L_Log ModelLog = new Model.L_Log();
                    DateTime dt = DateTime.Now;
                    ModelLog.Flag = "1";
                    ModelLog.LogDate = dt.ToShortDateString();
                    ModelLog.LogTime = dt.ToShortTimeString();
                    ModelLog.LogTxt = "退出系统";
                    ModelLog.OperCode = operinfo.OperCode;
                    ModelLog.OperName = operinfo.OperName;
                    ModelLog.ThCode = operinfo.ThName;
                    ModelLog.LogIP = Request.UserHostAddress;
                    DAL.L_Log.Add(ModelLog);
                }
                catch { }
            }   
            FormsAuthentication.SignOut();
            Session.Clear();
            Response.Write("<script>window.close();</script>");
        }
    }
}